package traceMyItems.server;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import traceMyItems.business.TraceMyItems;


public class SearchUserProjects extends HttpServlet{ 
  /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static final Logger log = Logger.getLogger(SearchItems.class.getName());
	
public void doGet(HttpServletRequest request, 
  HttpServletResponse response)
  throws ServletException,IOException{
  
	response.setContentType("text/x-json;charset=UTF-8");           
    response.setHeader("Cache-Control", "no-cache");
	log.info("Pedido de SEARCH_USER_PROJECTS recibido (GET)");
			
    	
	
	try
	{
		TraceMyItems objInstance = TraceMyItems.getInstance();
		response.getWriter().write(	objInstance.verProyectosDelUsuario());
				    	
	    		    
	}
	catch(Exception ex)
	{				
		log.warning("Excepcion buscando proyectos de usuario via (GET): "+ex.getMessage());
		response.getWriter().write(	"");
		
	}
	
	
  }

public void doPost(HttpServletRequest request, 
		  HttpServletResponse response)
		  throws ServletException,IOException
		  {
			String strJsonResponse = "";
			response.setContentType("text/x-json;charset=UTF-8");           
		    response.setHeader("Cache-Control", "no-cache");
		    
			log.info("Pedido de SEARCH_USERS_PROJECTS recibido (POST)");
					
		    	
			TraceMyItems objManager = TraceMyItems.getInstance();			
			
			try
			{
				
			
			    		    
			}
			catch(Exception ex)
			{				
				log.warning("Excepcion buscando proyectos del usuario: "+ex.getMessage());
				response.getWriter().write("");
		   
			}
			
		  }

}